using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class admin_EMP_Default : System.Web.UI.Page
{
    func fn = new func();
    
    protected void Page_Load(object sender, EventArgs e)
    {

        if (Session["username"] != null)
        {
            if (!IsPostBack)
            {
                //load info users
                lbUserName.Text = Session["username"].ToString();
                DataRow dr = fn.getUsersInfoByID(Session["userid"].ToString());
                lblFName.Text=dr["FirstName"].ToString();
                lblLastname.Text=dr["LastName"].ToString();
                lblPhone.Text = dr["phone"].ToString();
                lblAddress.Text = dr["Address"].ToString();

                string sql="select * from Branches where BranchID='" + Session["branchid"].ToString() + "'";
                DataRow dr2 = fn.GETDATAROWS(sql);
                lblBranch.Text = dr2["BranchName"].ToString();

                switch (Session["leveluser"].ToString()) { 
                    case "1":
                        lbllevel.Text = "Head Office";
                        break;
                    default:
                        lbllevel.Text = "Employee";
                        break;
                }
            }

        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        
    }
}
